﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using QLTV_Public;
using QLTV_BLL;

namespace QLTV_GiaoDien
{
    public partial class frm_ChiTietTheLoai : DevExpress.XtraEditors.XtraForm
    {
        public frm_ChiTietTheLoai()
        {
            InitializeComponent();
        }
        private string _TenTheLoai;

        public string TenTheLoai
        {
            get { return _TenTheLoai; }
            set { _TenTheLoai = value; }
        }
        ThongKe_BLL thongKe_bll = new ThongKe_BLL();
        public void LoadForm()
        {
           cob_TheLoai.Text = TenTheLoai;
            TheLoai_public tl = new TheLoai_public();
            tl.TenTheLoai = cob_TheLoai.Text;
            gridControl1.DataSource = thongKe_bll.ChiTiet_TheLoai(tl);
        }
        private void cob_TheLoai_TextChanged(object sender, EventArgs e)
        {
            TheLoai_public tl = new TheLoai_public();
            tl.TenTheLoai = cob_TheLoai.Text;
            gridControl1.DataSource = thongKe_bll.ChiTiet_TheLoai(tl);
        }

        private void bbi_Thoat_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            this.Close();
        }

        private void frm_ChiTietTheLoai_Load(object sender, EventArgs e)
        {
            LoadForm();
        }

        private void cob_TheLoai_Click(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();
            string sql = "select * from tbl_TheLoai";
            dt = thongKe_bll.TaoBang(sql);
            cob_TheLoai.DataSource = dt;
            cob_TheLoai.DisplayMember = "TenTheLoai";
        }

    }
}